package com.yanqu.road.server.cmd.activity.summergames.fromcross;


import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.SummerGamesProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = Protocol.S_SUMMER_GAMES_EXCHANGE_DONE_NOTIFY_FROM_CROSS, desc = "交换完成通知申请者(跨服返回)")
public class SummerGamesExchangeDoneNotifyCmd implements Command {

    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage yanQuMessage) throws Exception {
        SummerGamesProto.CrossSummerGamesExchangeDoneNotifyMsg msg = SummerGamesProto.CrossSummerGamesExchangeDoneNotifyMsg.parseFrom(yanQuMessage.getBytes());
        GamePlayerMgr.sendPacket(msg.getUserId(), YanQuMessageUtils.buildMessage(Protocol.C_SUMMER_GAMES_EXCHANGE_GET_DONE_REWARD, msg.toBuilder()));
    }
}
